package MP;

import MP.ASTs.AST;
import MP.lexicalanalysis.ErrorReporter;
import MP.lexicalanalysis.Scanner;
import MP.staticchecker.StaticChecker;
import MP.syntaxanalysis.Parser;
public class MPC {
    public static void main(String[] args) {
        String fileName = args[0];
        ErrorReporter reporter = new ErrorReporter();
		try {
			Scanner s = new Scanner(fileName,reporter);
			Parser p = new Parser(s,reporter);
			AST ast = p.parse();
			StaticChecker checker = new StaticChecker(ast);
			checker.parse();
		} catch (CompilationException e) {
            reporter.reportError(e.getMessage());
        }
    }
    public static int hash(String s) {
	    return s.hashCode();
    }
}
